<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%request.setAttribute("ctx", request.getContextPath());%>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap.min.css">
    <link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="<%=request.getContextPath() %>/css/theme.blue.css" type="text/css"></link>
    <script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.validate.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/js/my.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.tablesorter.js"></script>
    <script type="text/javascript">
        /*js代码区*/
    </script>
</head>
<body>
<br>
<br>
<br>
<br>
<br>
<br>
<div class="col-md-12">
    <div class="page-header">
        <h2>
            <small>管理员</small><br>
        </h2>
    </div>
    ${kcList}
    <div class="col-md-12">

        <table id="myTable" class="tablesorter-blue">
            <%--表头部分--%>
            <thead>
            <tr>
                <td>教师ID</td>
                <td>教师姓名</td>
                <td>课程id</td>
                <td>课程时间</td>
                <td>教室号</td>
                <td>学生姓名</td>
            </tr>
            </thead>

            <%--表格内容部分--%>
            <c:forEach items="${kcList}" var="l" varStatus="o">
                <tr>
                    <td>${o.index+1}</td>
                    <td>${l.teacher}</td>
                    <td>${l.kcId}</td>
                    <td>${l.time}</td>
                    <td>${l.address}</td>
                    <td>
                        <c:forEach items="${l.stus}" var="item">
                            ${item.stuName}
                        </c:forEach>
                    </td>
                </tr>
            </c:forEach>
                <tr>
                    <td colspan="15">
                        <div class="col-md-12">
                            <%--分页部分--%>
                            <ul class="pagination">
                                <%--首页--%>
                                <li class="page-item"><a class="page-link"
                                                         href="/kc/list?pageSize=${pageInfo.pageSize}&pageNum=1">首页</a>
                                </li>

                                <c:if test="${!pageInfo.isFirstPage}">
                                    <%--上一页--%>
                                    <li class="page-item">
                                        <a class="page-link"
                                           href="/kc/list?pageSize=${pageInfo.prePage}&pageNum=${pageInfo.pageNum}"><span>&laquo;</span></a>
                                    </li>
                                </c:if>


                                <c:forEach items="${pageInfo.navigatepageNums}" var="item">
                                    <%--导航条区域--%>
                                    <c:if test="${pageInfo.pageNum == item}">
                                        <li class="page-item active">
                                    </c:if>
                                    <c:if test="${pageInfo.pageNum != item}">
                                        <li class="page-item">
                                    </c:if>
                                    <a class="page-link"
                                       href="/kc/list?pageSize=${pageInfo.pageSize}&pageNum=${item}">${item}</a>
                                    </li>
                                </c:forEach>

                                <c:if test="${!pageInfo.isLastPage}">
                                    <%--下一页--%>
                                    <li class="page-item">
                                        <a class="page-link"
                                           href="/kc/list?pageSize=${pageInfo.nextPage}&pageNum=${pageInfo.pageNum}"><span>&raquo;</span></a>
                                    </li>
                                </c:if>
                                <%--尾页--%>
                                <li class="page-item"><a class="page-link"
                                                         href="/kc/list?pageSize=${pageInfo.pageSize}&pageNum=${pageInfo.pages}">尾页</a>
                                </li>
                            </ul>
                            <h2>共 ${pageInfo.total} 条数据,共 ${pageInfo.pages} 页</h2>
                        </div>
                    </td>
                </tr>

        </table>

    </div>
</div>
</body>
<script type="text/javascript">
    $("#myTable").tablesorter()
</script>
</html>